package cn.jly.spring.ioc.service.impl;

import cn.jly.spring.ioc.dao.UserDao;
import cn.jly.spring.ioc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * @author lanyangji
 * @description userService
 * @date 2020/11/10 上午 10:04
 */
@Service
public class UserServiceImpl implements UserService {

    /**
     * Qualifier根据指定bean名称注入
     */
    @Autowired
    @Qualifier(value = "userDaoImpl")
    private UserDao userDao;

    @Override
    public void add() {
        System.out.println("UserServiceImpl.add");
        userDao.add();
    }
}
